package controller;

import java.util.Observable;
import java.util.Observer;

import model.Model;
import view.View;

public class Presenter implements Observer
{
	View ui;
	Model model;
	public Presenter(Model m, View ui) {
		this.ui = ui;
		this.model = m;
		this.ui.addObserver(this);
		this.model.addObserver(this);
	}
	@Override
	public void update(Observable o, Object arg1) {
		if(o == this.ui){
			model.updateMe(ui.getCurrentCommand(), ui.getFilePath());
			//ui.displayData(model.getData());
		}
		else {
			ui.updateMe(model.getScore(), model.getData());
		}
		
	}
}
